<link rel="stylesheet" type="text/css" href="<?= base_url() ?>file/js/easyui/themes/gray/easyui.css">
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>file/js/easyui/themes/icon.css">

<script type="text/javascript" src="<?= base_url() ?>file/js/easyui/jquery.easyui.min.js"></script>


<div class="box">
	
	 <!-- box / title -->
	<div class="title">
			<h5>Nota Pengambilan Barang</h5>
	</div>

	<div class="table">
       

		<div class="panel-wrap" style="height: auto">
			
			<div class="panel-header-div">Informasi Teritori</div>
			<div class="panel-body-div">
				<div class="left-panel-body">
					<h2><?php echo $detail["header"]->territory_name; ?></h2>
				</div>
				
				<div class="right-panel-body">
					<table class="table-right-panel" width="100%" border="solid black 1px">
						<tr align="center" class="tr-colour">
							<th width="50%" align="center">Tanggal</th>
							<th align="center">No Pengambilan Barang</th>
						</tr>
						<tr align="center" class="gray">
							<td width="50%" align="center" style="font-size: 1.3em;">
								<?php echo date("d-m-Y", strtotime($detail["header"]->scan_date)); ?>
							</td>                    
							<td class="readonly" align="center" >
								<span style="font-size: 16pt"><b><?php echo $detail["header"]->scan_in_id; ?></b></span>
							</td>
							
						</tr>
					</table>
				
				</div>
				
			</div>
		</div>


	
		<div class="panel-wrap" style="height: auto">
			<div class="panel-header-div">Informasi Pengambilan Barang</div>
			<div class="panel-body-div">

        <table class="trans-info" style="margin: 10px; border: solid 1px #bbbbbb; font-size: 12px; width: 500px">
          <tbody>
            <tr>
              <td style="background: #efefef; border-right: solid 1px #cccccc">Nama Sales</td>
              <td><?php echo $detail['header']->user_id.' | '.$detail['header']->user_name; ?></td>
            </tr>
          </tbody>
        </table>

				<div class="child-panel-body">	
					<!-- <table id="table-updateable" class="table-right-panel" width="92%" style="margin-left: 19px;"> -->
					<table id="table-updateable" class="item-list">
						<thead>
							<tr align="center" class="tr-colour3">
								<th style="width:3%">No.</th>
								<th>ICCID</th>
								<th>MDN</th>
								<th>Keterangan</th>
								<th>Grup Item</th>
								<th>Harga (Rp.)</th>
							</tr>
						</thead>
						<tbody>
						<?php
						
							$subtotal = 0;
							$price = 0;
							$x=1;
							foreach ($detail["detail"] as $item) {
							?>
							<tr class="wide scan_in_details">
								<td><?=$x?></td>
								<td><?=$item->iccid?></td>
								<td><?=$item->mdn?></td>
								<td><?=$item->item_name?></td>
								<td><?=$item->item_group_name?></td>
								<td align="right">Rp. <?=number_format($item->f_get_price, 2, "," , ".")?></td>
							</tr>							
							<?php 
								$subtotal += $item->f_get_price;
								$x++;
							}

						?>
						</tbody>
						<tfoot>
							<tr>
								<td colspan="4"></td>
								<td>Subtotal</td>
								<td style="text-align: right">Rp. <?= number_format($subtotal, 2, "," , ".") ?></td>
							</tr>
						</tfoot>
						
					</table>					
				
				</div>
			
			
				<div class="child-panel-body-2">
				
					<div class="buttons-2" style="margin: 0 auto">
						<input type="button" value="Back" onclick="location.href='<?=base_url().'index.php/scan'?>'" />
					</div>
				</div>
				
			</div>
		</div>

	</div>
</div>